package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.nursing.dto.WechatNursingProjectDto;
import com.zzyl.serve.domain.NursingProject;
import com.zzyl.serve.service.INursingProjectService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

import static com.zzyl.common.utils.PageUtils.startPage;

@RestController
@RequestMapping("/member/orders")
public class MemberOrderController  extends BaseController {

    @Autowired
    private INursingProjectService nursingProjectService;

    /**
     * 查询护理项目列表
     */

    @GetMapping("/project/page")
    @ApiOperation(value = "获取护理项目列表")
    public TableDataInfo<List<NursingProject>> list( WechatNursingProjectDto dto)
    {
        startPage();
        List<NursingProject> list = nursingProjectService.selectProjectAll(dto);
        return getDataTable(list);
    }
/**
 * 根据id查询护理项目详情
 */
    @GetMapping("/project/{id}")
    @ApiOperation(value = "根据id查询护理项目详情")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(nursingProjectService.selectNursingProjectById(id));
    }

}
